<html>
<head><meta charset="utf-8"><title>Installing and using a local miri · miri · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/index.html">miri</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html">Installing and using a local miri</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223646941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223646941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Corey Farwell <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223646941">(Jan 22 2021 at 14:22)</a>:</h4>
<p>hi all, trying out miri for my first time today. i opened a pull request a minute ago for adding a shim for a libc api that my aarch64 laptop uses: <a href="https://github.com/rust-lang/miri/pull/1683">https://github.com/rust-lang/miri/pull/1683</a> i'm interested in re-running miri on my project with this change. what would be the easiest way to do that? i assume it's not as simple as <code>cargo install --path ~/dev/miri</code></p>



<a name="223647315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223647315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223647315">(Jan 22 2021 at 14:25)</a>:</h4>
<p>Instructions for using locally built miri can be found in the contrib guide: <a href="https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#preparing-the-build-environment">https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#preparing-the-build-environment</a></p>



<a name="223647431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223647431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223647431">(Jan 22 2021 at 14:26)</a>:</h4>
<p>please let us know if you encounter anything that you got stuck on or found confusing so we can fix the instructions</p>



<a name="223647654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223647654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Corey Farwell <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223647654">(Jan 22 2021 at 14:28)</a>:</h4>
<p>thanks! i'll take a look</p>



<a name="223650757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223650757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Corey Farwell <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223650757">(Jan 22 2021 at 14:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> it seemed like it mostly worked! but i tried running <code>cargo miri</code> again on my project and it seems like the change i made was not reflected. it looks like my <code>cargo-miri</code> i built has a different checksum than the one on my path:</p>
<p><a href="/user_uploads/4715/2rHlt6WQuAI5LwTSbQwOClyy/Screen-Shot-2021-01-22-at-9.50.48-AM.png">Screen-Shot-2021-01-22-at-9.50.48-AM.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/2rHlt6WQuAI5LwTSbQwOClyy/Screen-Shot-2021-01-22-at-9.50.48-AM.png" title="Screen-Shot-2021-01-22-at-9.50.48-AM.png"><img src="/user_uploads/4715/2rHlt6WQuAI5LwTSbQwOClyy/Screen-Shot-2021-01-22-at-9.50.48-AM.png"></a></div><p>is <code>./miri install</code> supposed to replace the one on my path?</p>



<a name="223651317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223651317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Corey Farwell <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223651317">(Jan 22 2021 at 14:56)</a>:</h4>
<p>confirmed that injecting <code>target/aarch64-apple-darwin/release/</code> into my path uses the correct miri, so if it's supposed to be replacing my old <code>cargo-miri</code>, that doesn't appear to be working</p>



<a name="223651986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223651986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223651986">(Jan 22 2021 at 15:01)</a>:</h4>
<p>The only thing that comes to mind is</p>
<blockquote>
<p>Make sure you use the same toolchain when calling cargo miri that you used when installing Miri!</p>
</blockquote>
<p>from the docs</p>



<a name="223652055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223652055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223652055">(Jan 22 2021 at 15:01)</a>:</h4>
<p>also note that <code>cargo-miri</code> in <code>.cargo/bin</code> is just a script that forwards to the actual <code>cargo miri</code> I think</p>



<a name="223652176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223652176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Corey Farwell <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223652176">(Jan 22 2021 at 15:02)</a>:</h4>
<p>ah that might have been it. i didn't switch toolchains until now. thanks!</p>



<a name="223743270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223743270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223743270">(Jan 23 2021 at 10:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri/near/223652055">said</a>:</p>
<blockquote>
<p>also note that <code>cargo-miri</code> in <code>.cargo/bin</code> is just a script that forwards to the actual <code>cargo miri</code> I think</p>
</blockquote>
<p>no it should be a binary</p>



<a name="223743331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223743331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223743331">(Jan 23 2021 at 10:44)</a>:</h4>
<p>rustup installs itself into that location, but <code>./miri install</code> should overwrite that</p>



<a name="223825689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223825689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kkrazy <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223825689">(Jan 24 2021 at 17:47)</a>:</h4>
<p>trying out miri for the first time, cloned the code and trying to build, getting the following errors:</p>
<p>kkrazy@kkrazy:/opt/kkrazy/miri$ ./miri install<br>
  Installing miri v0.1.0 (/opt/kkrazy/miri)<br>
   Compiling miri v0.1.0 (/opt/kkrazy/miri)<br>
error[E0463]: can't find crate for <code>rustc_attr</code><br>
  --&gt; src/lib.rs:11:1<br>
   |<br>
11 | extern crate rustc_attr;<br>
   | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate</p>
<p>error: aborting due to previous error</p>
<p>Am I missing something?</p>



<a name="223826217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223826217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223826217">(Jan 24 2021 at 17:58)</a>:</h4>
<p>You need to run <code>rustup component add rustc-dev llvm-tools-preview</code>.</p>



<a name="223826430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223826430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223826430">(Jan 24 2021 at 18:02)</a>:</h4>
<p><span class="user-mention" data-user-id="383653">@kkrazy</span> if you just want to try Miri, the recommended way is <code>rustup component add miri</code> -- building it from-source is tricky, as you noticed</p>



<a name="223826436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223826436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223826436">(Jan 24 2021 at 18:03)</a>:</h4>
<p>if you want to work on miri itself or build from source for other reasons, see <a href="https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md">https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md</a></p>



<a name="223827007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223827007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kkrazy <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223827007">(Jan 24 2021 at 18:15)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span>  seems to be the same error after run the cmd.</p>



<a name="223827080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/Installing%20and%20using%20a%20local%20miri/near/223827080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kkrazy <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/Installing.20and.20using.20a.20local.20miri.html#223827080">(Jan 24 2021 at 18:16)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>  thx. simply adding miri and switch to nightly channel worked.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>